﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EPPLib.Data;
using EPPLib.Managers;

namespace EPPWebMVC.Controllers
{
    public class TransactionLogController : BaseController
    {        
        [Authorize]
        public ActionResult Index()
        {
            TransactionLogDataCollection transactionLogs = Data.ReadTransactionLogs(CurrentUserID);
            SetBaseViewData();
            return View(transactionLogs);
        }
        
        [Authorize]
        public ActionResult Detail(int id)
        {
            TransactionLogDataObject transactionLog = Data.ReadTransactionLog(id, CurrentUserID);
            SetBaseViewData();
            return View(transactionLog);
        }

        [Authorize]
        public ActionResult Clear()
        {
            Data.ClearTransactionLogs(CurrentUserID);
            return RedirectToAction("Index");
        }
    }
}
